var AllOptions = {
    createOption1(dataList) { //省内疫苗生产企业经济现状
        return {
            color: ['rgba(235, 52, 50, 1)', 'rgba(255, 151, 34, 1)', 'rgba(41, 161, 247, 1)', 'rgba(5, 209, 135, 1)', ],
            grid: {
                left: 0,
                top: 10,
                bottom: 20,
                right: 20
            },
            series: [{
                type: 'pie',
                radius: [20, 130],
                center: ['50%', '50%'],
                roseType: 'area',
                stillShowZeroSum: false,
                labelLine: {
                    length: 10,
                    length2: 10
                },
                label: {
                    normal: {
                        formatter: function (params) {
                            var stringTxt = params.name;
                            var val = params.percent;
                            return /\S{3}/.test(stringTxt) ? stringTxt.replace(/\s/g, '').replace(/(.{4})/g, "$1 \n") + val + '%' : strstringTxting + val + '%';


                        },
                        fontSize: 16,
                    }
                },
                data: dataList
            }]
        }

    },
    createOption2(labelList, yearLable, dataList) { //省内疫苗生产企业经济现状/历年企业抽检不合格项目情况/历年企业投诉举报情况
        return {
            color: ['rgba(177, 211, 33, 1)', 'rgba(245, 166, 35, 1)', 'rgba(34, 137, 242, 1)'],
            grid: {
                left: 60,
                top: 70,
                bottom: 50,
                right: 20
            },
            title: {
                text: '单位：个',
                textStyle: {
                    color: '#fff',
                    fontSize: 16
                },
                left: 10,
                top: 20
            },
            legend: {
                show: true,
                top: 10,
                // right: 40,
                zlevel: 10,
                icon: 'roundRect',
                itemWidth: 20, // 设置宽度
                itemHeight: 14, // 设置高度
                itemGap: 20, // 设置间距
                textStyle: {
                    color: '#fff',
                    fontSize: 16
                },
            },
            xAxis: {
                type: 'category',
                data: labelList.map(label => {
                    label = (label.length > 5 ? (label.substring(0, 5) + '\n' + label.substring(5)) : label);
                    return label
                }),
                axisLabel: {
                    inside: false,
                    textStyle: {
                        color: '#fff',
                        fontSize: 16
                    },
                    interval: 0, //保证所有横向坐标数据全展示不隐藏
                    margin: 10 //刻度与坐标轴距离
                },
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: true, //显示y轴
                    symbol: ['none'],
                    symbolOffset: [0, 14],
                    lineStyle: {
                        color: 'rgba(1, 60, 217, 1)'
                    }
                },
                splitLine: {
                    show: false, //纵向网格线
                    lineStyle: {
                        color: ['#334c69']
                    }
                }
            },
            yAxis: {
                type: 'value',
                axisLabel: {
                    inside: false,
                    textStyle: {
                        color: '#fff',
                        fontSize: 16
                    },
                    // interval: 0,
                    margin: 20 //刻度与坐标轴距离
                },
                axisTick: {
                    show: false //不显示刻度
                },
                axisLine: {
                    show: true, //显示y轴
                    // symbol: ['none', 'arrow'],
                    // symbolOffset: [0, 14],
                    lineStyle: {
                        color: 'rgba(1, 60, 217, 1)'
                    }
                },
                splitLine: {
                    show: false, //横向网格线
                    lineStyle: {
                        color: ['#334c69']
                    }
                },
                splitArea: {
                    show: true, //横向网格区域
                    areaStyle: {
                        color: ['rgba(0, 70, 255, 0.1)', 'rgba(5,39,75,0)']
                    }
                },

            },
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 横坐标指示器
                    type: 'line',
                    lineStyle: {
                        color: 'rgba(0,0,0,0)'
                    }
                },
                // alwaysShowContent: true, //悬浮后一直显示
                // 自定义悬浮提示框内容（数据处理后加单位）
                backgroundColor: 'rgba(0,0,0,0)',
                formatter(params) { // params的个数等于折线的条数（对多条折线数据进行加单位，就需要遍历）
                    var relVal = '<div class="bg_2_tip" style="text-align:left;padding:20px 30px;font-size:14px "><span style="color:#fff;font-size:20px">' + params[0].name + '</span>' + (params[0] ? '<br><span class="color-blue-2">' + params[0].seriesName + '<span class="color-yellow-2 f20 pl10">' + params[0].value + '</span>个</span>' : '') + '' + (params[1] ? '<br><span class="color-blue-2">' + params[1].seriesName + '<span class="color-yellow-2 f20 pl10">' + params[1].value + '</span>个</span>' : '') + '' + (params[2] ? '<br><span class="color-blue-2">' + params[2].seriesName + '<span class="color-yellow-2 f20 pl10">' + params[2].value + '</span>个</span>' : '') + '' + (params[3] ? '<br><span class="color-blue-2">' + params[3].seriesName + '<span class="color-yellow-2 f20 pl10">' + params[3].value + '</span>个</span>' : '') + '</div>'
                    return relVal
                }
            },
            series: [{
                name: yearLable[0],
                type: 'bar',
                data: dataList[0],
                barMaxWidth: '20',
                barGap: '1%',
                itemStyle: {
                    barBorderRadius: [3, 3, 0, 0]
                }
            }, {
                name: yearLable[1],
                type: 'bar',
                data: dataList[1],
                barMaxWidth: '20',
                barGap: '1%',
                itemStyle: {
                    barBorderRadius: [3, 3, 0, 0]
                }
            }, {
                name: yearLable[2],
                type: 'bar',
                data: dataList[2],
                barMaxWidth: '20',
                barGap: '1%',
                itemStyle: {
                    barBorderRadius: [3, 3, 0, 0]
                }
            }]
        }
    },
    createOption3(labelList, dataList, color, unit) { //省内疫苗生产企业经济现状
        return {
            color: [color],
            grid: {
                left: 60,
                top: 40,
                bottom: 50,
                right: 20
            },
            label: {
                show: true,
                position: 'top',
                formatter: '{c}',
                color: '#fff',
                fontSize: 16
            },
            title: {
                text: '(单位：' + (unit || '个') + ')',
                textStyle: {
                    color: '#fff',
                    fontSize: 16
                },
                left: 10,
                top: 0
            },
            legend: {
                show: true,
                top: 10,
                // right: 40,
                zlevel: 10,
                icon: 'roundRect',
                itemWidth: 20, // 设置宽度
                itemHeight: 14, // 设置高度
                itemGap: 20, // 设置间距
                textStyle: {
                    color: '#fff',
                    fontSize: 16
                },
            },
            xAxis: {
                type: 'category',
                data: labelList.map(label => {
                    label = (label.length > 5 ? (label.substring(0, 5) + '\n' + label.substring(5)) : label);
                    return label
                }),
                axisLabel: {
                    inside: false,
                    textStyle: {
                        color: '#fff',
                        fontSize: 16
                    },
                    interval: 0, //保证所有横向坐标数据全展示不隐藏
                    margin: 10 //刻度与坐标轴距离
                },
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: true, //显示y轴
                    symbol: ['none'],
                    symbolOffset: [0, 14],
                    lineStyle: {
                        color: 'rgba(1, 60, 217, 1)'
                    }
                },
                splitLine: {
                    show: false, //纵向网格线
                    lineStyle: {
                        color: ['#334c69']
                    }
                }
            },
            yAxis: {
                type: 'value',
                axisLabel: {
                    inside: false,
                    textStyle: {
                        color: '#fff',
                        fontSize: 16
                    },
                    // interval: 0,
                    margin: 20 //刻度与坐标轴距离
                },
                axisTick: {
                    show: false //不显示刻度
                },
                axisLine: {
                    show: true, //显示y轴
                    // symbol: ['none', 'arrow'],
                    // symbolOffset: [0, 14],
                    lineStyle: {
                        color: 'rgba(1, 60, 217, 1)'
                    }
                },
                splitLine: {
                    show: false, //横向网格线
                    lineStyle: {
                        color: ['#334c69']
                    }
                },
                splitArea: {
                    show: true, //横向网格区域
                    areaStyle: {
                        color: ['rgba(0, 70, 255, 0.1)', 'rgba(5,39,75,0)']
                    }
                },

            },
            // tooltip: {
            //     trigger: 'axis',
            //     axisPointer: { // 横坐标指示器
            //         type: 'line',
            //         lineStyle: {
            //             color: 'rgba(0,0,0,0)'
            //         }
            //     },
            //     // alwaysShowContent: true, //悬浮后一直显示
            //     // 自定义悬浮提示框内容（数据处理后加单位）
            //     backgroundColor: 'rgba(0,0,0,0)',
            //     formatter(params) { // params的个数等于折线的条数（对多条折线数据进行加单位，就需要遍历）
            //         var relVal = '<div class="bg_2_tip" style="text-align:left;padding:20px 30px;font-size:14px "><span style="color:#fff;font-size:20px">' + params[0].name + '</span>' + (params[0] ? '<br><span class="color-blue-2">' + params[0].seriesName + '<span class="color-yellow-2 f20 pl10">' + params[0].value + '</span>个</span>' : '') + '' + (params[1] ? '<br><span class="color-blue-2">' + params[1].seriesName + '<span class="color-yellow-2 f20 pl10">' + params[1].value + '</span>个</span>' : '') + '' + (params[2] ? '<br><span class="color-blue-2">' + params[2].seriesName + '<span class="color-yellow-2 f20 pl10">' + params[2].value + '</span>个</span>' : '') + '' + (params[3] ? '<br><span class="color-blue-2">' + params[3].seriesName + '<span class="color-yellow-2 f20 pl10">' + params[3].value + '</span>个</span>' : '') + '</div>'
            //         return relVal
            //     }
            // },
            series: [{
                type: 'bar',
                data: dataList,
                barMaxWidth: '32',
                barGap: '1%',
            }]
        }
    },

    createOption4(dataList, colors) { //企业抽样检测不合格项目分析/企业投诉举报情况查询
        return {
            color: colors,
            grid: {
                top: 0,
            },
            series: [{
                name: '',
                type: 'pie',
                radius: '70%',
                center: ['50%', '40%'],
                data: dataList,
                label: {

                    normal: {
                        position: 'inside',
                        formatter: '{b}\n{c}%',
                        fontSize: 16,
                    }
                },
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }]
        }
    }

}